package mn.idax.exchange.otc.constant;

import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;

/**
 * @author .jension
 * @time 2018.11.12
 */
public class ReferenceExchageConstant {

    public static final String BTC = "BTC";
    public static final String ETH = "ETH";
    public static final String USDT = "USDT";
    public static final String BITCNY = "BITCNY";
    public static final String CZZ = "CZZ";

    public static final String USDTCNY = "USDTCNY";

    /**
     * 查询的交易对数字货币
     **/
    public static final String[] marketPairs = new String[]{BTC, ETH, USDT,BITCNY,CZZ};
    /***
     * 交易对分割符
     */
    public static final String DELIMITER = "_";
    /**
     * 交易对的查询法币 USD
     **/
    public static final String currencyUSD = "USD";
    public static final String currencyKRW = "KRW";
    public static final String currencyCNY = "CNY";
    public static final String currencyEUR = "EUR";
    public static final String currencySGD = "SGD";
    public static final String currencyVND = "VND";
    public static final String currencyMYR = "MYR";
    public static final String currencyIRR = "IRR";

    /**
     * 全部法币
     **/
    public static final String[] allCurrency = new String[]{currencyUSD, currencyKRW, currencyCNY, currencyEUR, currencySGD, currencyVND, currencyMYR,currencyIRR};
    public static final Map<String, String> CURRENCY_CORRESPONDING_KEY = new HashMap<String, String>() {
        {
            put(currencyKRW, "data21");
            put(currencyEUR, "data2");
            put(currencySGD, "data9");
            put(currencyVND, "data9");
            put(currencyMYR, "data19");
        }
    };

    /**
     * 小数位数
     */
    public static final int DECIMAL = 2;

    /**
     * 参考交易所名称
     **/
    public static final String COINMARKETCAP = "coinmarketcap";
    /**
     * coinmarketcap交易所TetherName
     */
    public static final Map<String, String> coinmarketcapTetherName = new HashMap<String, String>() {
        {
            // BTC == Bitcoin
            put(marketPairs[0], "Bitcoin");
            // ETH == Ethereum
            put(marketPairs[1], "Ethereum");
            // USDT == tether
            put(marketPairs[2], "tether");
        }
    };

    public static final String BITSTAMP = "bitstamp";
    public static final String BITFINEX = "bitfinex";
    public static final String AVERAGE = "average";
    public static final String BITCNY_EXCHANGE = "average";
    public static final String CZZ_EXCHANGE = "average";
    public static final String[] exchangeName = new String[]{COINMARKETCAP, BITSTAMP, BITFINEX};

    /**
     * 参考交易所对应的API
     */
    public static final Map<String, MessageFormat> exchangeApiUrl = new HashMap<String, MessageFormat>() {
        {
            put(COINMARKETCAP, new MessageFormat("https://api.coinmarketcap.com/v1/ticker/{0}/?convert={1}"));
            put(BITSTAMP, new MessageFormat("https://www.bitstamp.net/api/v2/ticker/{0}{1}/"));
            put(BITFINEX, new MessageFormat("https://api.bitfinex.com/v1/pubticker/{0}{1}"));
        }
    };

    /**
     * zb 没有BITCNY/USDT行情 调了两次
     */
    public static final String ZI_BITCNY_QC_API = "http://api.zb.plus/data/v1/ticker?market=bitcny_qc";
    public static final String ZI_USDT_QC_API = "http://api.zb.plus/data/v1/ticker?market=usdt_qc";

    /**
     * 聚合数据汇率API
     */
//    public static final String juheRateApi = "http://web.juhe.cn:8080/finance/exchange/rmbquot?type=&bank=&key=7c0ae9855ff766bbe9e8964fdf27d91e";

    public static final String respResultSuccessCode = "0000000";

    /**
     * 存储到redis中汇率KEY
     */
    public static final String REDIS_RATE_KEY = "rmbquot_rate";

    public static final String redisExchangeFileName = "ReferenceExchage";

    public static final String REDIS_FLOATING_RATE_KEY = "OTC:FLOATING:RATE";

    public static final String HashMarket = "HashMarket";


}
